<template>
    <Thumbnail404 v-if="!isFind"></Thumbnail404>
  <div class="drama" v-else-if="dramaList.length>0">
      <Drama
        v-for="drama in dramaList"
        :key="drama.id"
        :drama="drama"
      ></Drama>
  </div>
  <ThumbnailLoading v-else></ThumbnailLoading>
</template>

<script>
import Thumbnail404 from "components/public/Thumbnail404"
import ThumbnailLoading from "components/public/ThumbnailLoading"
import Drama from "components/search/Drama"
import { get } from "util/http"
export default {
    data(){
        return {
            dramaList:[],
            isFind:true
        }
    },
    components:{
        Drama,
        ThumbnailLoading,
        Thumbnail404
    },
    async mounted(){
        let result=await get({
            url:"/ajax/dramaapi/search",
            params:{
                s:this.$route.params.keyword,
                p:1
            }
        })
        this.dramaList=result.info.Datas
        if(!result.info.Datas||result.info.Datas.length===0){
            this.isFind=false
        }
    }
}
</script>

<style lang="stylus" scoped>

</style>